﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cassandraemon.Connection
{
	public interface ICassandraNodeEnumerator
	{
		/// <summary>
		/// Returns next set of nodes.
		/// This mehtod is called everytime <see cref="CassandraContext"/> is created.
		/// </summary>
		/// <returns>A list of nodes to connect in order.</returns>
		IEnumerable<string> NextNodes();

		/// <summary>
		/// Upate the node list.
		/// <see cref="ConnectionPool"/> calls this method on initialization
		/// and after errors.
		/// Once the node list was determined, this method should call
		/// <see cref="ConnectionPool.UpdateNodes"/> to update nodes in the pool.
		/// </summary>
		void UpdateNodes();
	}
}
